import {
    createRouter,
    createWebHashHistory,
} from 'vue-router'
// import Index from "~/pages/index.vue"
import adminLayout from "~/layouts/index.vue"
import NotFound from "~/pages/404.vue"
import login from "~/pages/login.vue"
const routes = [
    {
        path: '/',
        name: 'Home',
        component:adminLayout,
        // redirect: '/index',
        children: [
            {
                path: '/',
                component: () => import('~/pages/index.vue'),
                name: 'index',
                meta: {
                    title: '首页',
                }
            },
            {
                path: '/goods/list',
                component: () => import('~/pages/goods/goodsList.vue'),
                name: 'goodsList',
                meta: {
                    title: '商品列表',
                }
            },
            {
                path: '/category/list',
                component: () => import('~/pages/goods/classifyManage.vue'),
                name: 'classifyManage',
                meta: {
                    title: '分类管理',
                }
            },
        ]
    },
    {
        path: '/login',
        name: 'login',
        component:login,
    },
    {
        path: '/:pathMatch(.*)*',
        name: 'NotFound',
        component: NotFound,
    }
  
]

const router = createRouter({
    history: createWebHashHistory(),
    routes,
})

export default router